﻿<Window x:Class="SunwellLauncher.MainWindow" x:Name="MainWin" Cursor="Cursors/normal.cur"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:SunwellLauncher="clr-namespace:SunwellLauncher"
        Title="Sunwell launcher" Height="325" Width="575" ResizeMode="NoResize" WindowStyle="None" Loaded="Window_Loaded" 
        MouseLeftButtonDown="Window_MouseLeftButtonDown" Icon="/SunwellLauncher;component/Images/World_of_Warcraft___Icon_by_Onix9.png" 
        AllowsTransparency="True" Background="{x:Null}" Closing="MainWin_Closing" LocationChanged="MainWin_LocationChanged" 
        WindowStartupLocation="CenterScreen" BorderThickness="0" DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Window.Resources>
        <Style x:Key="ListboxItemStyle" TargetType="{x:Type ListBoxItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <Grid>
                            <Border Background="{TemplateBinding Background}" />
                            <Border Background="#BEFFFFFF">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Border Grid.Row="0" Background="#57FFFFFF" />
                                </Grid>
                            </Border>
                            <ContentPresenter Margin="0" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsMouseOver" Value="True" />
                                    <Condition Property="IsSelected" Value="False"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" Value="Snow" />
                            </MultiTrigger>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="Background" Value="Gold" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="Window.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.3" FillBehavior="HoldEnd" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="btnExit">
            <BeginStoryboard>
                <Storyboard x:Name="closeStoryBoard" Completed="closeStoryBoard_Completed">
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.5" FillBehavior="HoldEnd" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="550*" />
            <ColumnDefinition Width="167*" />
        </Grid.ColumnDefinitions>
        <Border x:Name="brdContentBorder" Grid.ColumnSpan="2" BorderBrush="#D3000000" BorderThickness="4">
            <Grid x:Name="grdContent" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="15*" />
                <ColumnDefinition Width="437*" />
                <ColumnDefinition Width="91*" />
                <ColumnDefinition Width="10*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="20*" />
                <RowDefinition Height="206*" />
                <RowDefinition Height="60*" />
            </Grid.RowDefinitions>
            <StackPanel Grid.ColumnSpan="4">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="499*" />
                        <ColumnDefinition Width="23*" />
                        <ColumnDefinition Width="23*" />
                    </Grid.ColumnDefinitions>
                    <Button x:Name="btnMinimalize" Cursor="Cursors/hover.cur" Height="20" Click="btnMinimalize_Click" Grid.Column="1">
                        <Button.Background>
                            <ImageBrush ImageSource="/SunwellLauncher;component/Images/_.png" />
                        </Button.Background>
                    </Button>
                    <Button x:Name="btnExit" Cursor="Cursors/hover.cur" Grid.Column="2" Height="20">
                        <Button.Background>
                            <ImageBrush ImageSource="/SunwellLauncher;component/Images/x.png"></ImageBrush>
                        </Button.Background>
                    </Button>
                </Grid>
            </StackPanel>
            <Button x:Name="btnPlay" Cursor="Cursors/hover.cur" Grid.Row="2" Grid.Column="2" Content="Play" Grid.ColumnSpan="2" Margin="0,0,10,10" Click="btnPlay_Click" FontSize="16" FontWeight="Light" Foreground="#FFD6B545" BorderBrush="{x:Null}" BorderThickness="1">
                <Button.Background>
                    <ImageBrush ImageSource="/SunwellLauncher;component/Images/button_normal.png" Stretch="Fill" TileMode="None" />
                </Button.Background>
            </Button>
            <Button x:Name="btnRealmlist" Cursor="Cursors/hover.cur" Grid.Column="3" Grid.Row="1" Click="btnRealmlist_Click" Margin="0,30" BorderBrush="Black">
                <Button.Background>
                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                        <GradientStop Color="Black" Offset="0" />
                        <GradientStop Color="#FF006D9A" Offset="1" />
                    </LinearGradientBrush>
                </Button.Background>
            </Button>
            <Grid Grid.Column="1" Grid.Row="2" Margin="0,0,90,0" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*" />
                    <ColumnDefinition Width="1*" />
                </Grid.ColumnDefinitions>
                <Border Margin="5,0,10,10" BorderBrush="Black" BorderThickness="2">
                    <Grid x:Name="grdRealm1" MouseEnter="grdRealm1_MouseEnter" MouseLeave="grdRealm1_MouseLeave">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1.5*" />
                            <RowDefinition Height="1*" />
                            <RowDefinition Height="1*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="51*" />
                            <ColumnDefinition Width="89*" />
                                <ColumnDefinition Width="56*" />
                            </Grid.ColumnDefinitions>
                            <Image x:Name="imgRealm1Type" Grid.Column="2" Grid.RowSpan="3" Source="/SunwellLauncher;component/Images/flag.png" Stretch="None" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
                            <Label x:Name="lblRealm1Type" Content="PvP" Grid.RowSpan="2" Grid.Column="2" Padding="0" FontSize="14" FontWeight="DemiBold" Foreground="#FFE5C34F" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" >
                                <Label.Effect>
                                    <DropShadowEffect  BlurRadius="4" ShadowDepth="3" />
                                </Label.Effect>
                            </Label>
                            <Label x:Name="lblRealm1Name" Content="Feronis" Grid.Column="1" Padding="0" FontSize="17" FontWeight="Bold" Foreground="#FFE5C34F" >
                                <Label.Effect>
                                    <DropShadowEffect  BlurRadius="8" ShadowDepth="4" />
                                </Label.Effect>
                            </Label>
                            <Label x:Name="lblRealm1Uptime" Content="Up: 3d 10h 39m" Grid.Column="1" Grid.Row="1" FontSize="10" Padding="0" Grid.RowSpan="2" Foreground="White" Grid.ColumnSpan="2" />
                        <Label x:Name="lblRealm1Players" Content="Players: 1354 (max 2520)" Grid.Column="1" Grid.Row="2" FontSize="10" Padding="0" Foreground="White" Grid.ColumnSpan="2" />
                        <Label x:Name="lblRealm1AllyVsHorde" Grid.Column="1" Grid.RowSpan="2" FontSize="28" FontWeight="bold" Padding="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Visibility="Hidden" VerticalAlignment="Bottom" FontFamily="Rockwell" Grid.ColumnSpan="2">
                                <TextBlock x:Name="txtbRealm1AllyVsHorde" FontSize="18" Foreground="white">
                                    <TextBlock.Effect>
                                    <DropShadowEffect
                                      ShadowDepth="6"
                                      Direction="315"
                                      Color="Black"
                                      Opacity="0.8"
                                      BlurRadius="0.8" />
                                  </TextBlock.Effect>
                                </TextBlock>
                        </Label>
                        <Label x:Name="lblRealm1AvgDiff" Content="Average diff: 50ms" Grid.Column="1" Grid.Row="2" FontSize="10" Padding="0" Foreground="White" Visibility="Hidden" Grid.ColumnSpan="2" />
                        <Image x:Name="imgRealm1" Source="/SunwellLauncher;component/Images/status_up.png" Grid.RowSpan="3" Margin="5" />
                        <Grid.Background>
                            <ImageBrush ImageSource="/SunwellLauncher;component/Images/right-bg.jpg" Stretch="None" TileMode="None" />
                        </Grid.Background>
                    </Grid>
                </Border>
                <Border Grid.Column="1" Margin="5,0,10,10" BorderBrush="Black" BorderThickness="2">
                    <Grid x:Name="grdRealm2" Grid.Column="1"  MouseEnter="grdRealm2_MouseEnter" MouseLeave="grdRealm2_MouseLeave">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1.5*" />
                            <RowDefinition Height="1*" />
                            <RowDefinition Height="1*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="51*" />
                            <ColumnDefinition Width="89*" />
                                <ColumnDefinition Width="56*" />
                            </Grid.ColumnDefinitions>
                            <Image x:Name="imgRealm2Type" Grid.Column="2" Grid.RowSpan="3" Source="/SunwellLauncher;component/Images/flag.png" Stretch="None" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
                            <Label x:Name="lblRealm2Type" Content="PvP" Grid.RowSpan="2" Grid.Column="2" Padding="0" FontSize="14" FontWeight="DemiBold" Foreground="#FFE5C34F" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" >
                                <Label.Effect>
                                    <DropShadowEffect  BlurRadius="4" ShadowDepth="3" />
                                </Label.Effect>
                            </Label>
                            <Label x:Name="lblRealm2Name" Content="Stormrage" Grid.Column="1" Padding="0" FontSize="17" FontWeight="Bold" Foreground="#FFE5C34F" >
                                <Label.Effect>
                                    <DropShadowEffect  BlurRadius="8" ShadowDepth="4" />
                                </Label.Effect>
                            </Label>
                            <Label x:Name="lblRealm2Uptime" Content="Up: 3d 20h 29m" Grid.Column="1" Grid.Row="1" FontSize="10" Padding="0" Foreground="White" Grid.ColumnSpan="2" />
                        <Label x:Name="lblRealm2Players" Content="Players: 22 (max 114)" Grid.Column="1" Grid.Row="2" FontSize="10" Padding="0" Foreground="White" Grid.ColumnSpan="2" />
                            <Label x:Name="lblRealm2AllyVsHorde" Grid.Column="1" Grid.RowSpan="2" FontSize="28" FontWeight="bold" Padding="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" Visibility="Hidden" VerticalAlignment="Bottom" FontFamily="Rockwell" Grid.ColumnSpan="2">
                                <TextBlock x:Name="txtbRealm2AllyVsHorde" FontSize="18" Foreground="white">
                                    <TextBlock.Effect>
                                    <DropShadowEffect
                                      ShadowDepth="6"
                                      Direction="315"
                                      Color="Black"
                                      Opacity="0.8"
                                      BlurRadius="0.8" />
                                  </TextBlock.Effect>
                                </TextBlock>
                            </Label>
                        <Label x:Name="lblRealm2AvgDiff" Content="Average diff: 50ms" Grid.Column="1" Grid.Row="2" FontSize="10" Padding="0" Foreground="White" Visibility="Hidden" Grid.ColumnSpan="2" />
                        <Image x:Name="imgRealm2" Source="/SunwellLauncher;component/Images/status_up.png" Grid.RowSpan="3" Margin="5" />
                        <Grid.Background>
                            <ImageBrush ImageSource="/SunwellLauncher;component/Images/right-bg.jpg" Stretch="None" TileMode="None" />
                        </Grid.Background>
                        </Grid>
                </Border>
            </Grid>
            <Grid Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Margin="0,10,10,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40*" />
                    <RowDefinition Height="20*" />
                    <RowDefinition Height="126*" />
                </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="186*" />
                        <ColumnDefinition Width="332*" />
                    </Grid.ColumnDefinitions>
                    <Image Source="/SunwellLauncher;component/Images/content-rightborder.jpg" Grid.RowSpan="3" Grid.Column="1" Stretch="Fill" Margin="0,23,0,0" HorizontalAlignment="Right" Width="17" />
                     <Image Source="/SunwellLauncher;component/Images/content-top.jpg" Grid.ColumnSpan="2" Stretch="UniformToFill" />
                <Border BorderBrush="#FFBA943D" BorderThickness="3" Grid.RowSpan="3" Margin="10,20">
                    <Image x:Name="imgNewsImg" Grid.RowSpan="3" />
                </Border>
                <Label x:Name="lblNewsTitle" Grid.Column="1" Content="Title" FontSize="16" Margin="0,10,0,0" Padding="5,5,5,0" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom" FontWeight="Bold" Foreground="#FF884B1E" />
                    <Label x:Name="lblNewsCreatedBy" Grid.Column="1" Grid.Row="1" Content="Created by" Margin="0" FontSize="10" VerticalAlignment="Top" Padding="5,0,5,5" Foreground="#FF563C23" FontWeight="Bold"/>
                <ScrollViewer VerticalScrollBarVisibility="Hidden" Grid.Column="1" Grid.Row="2" Margin="0,0,0,20">
                    <TextBlock x:Name="txtbNewsContent"  Text="Content" Margin="0" Padding="5,0,5,10" TextWrapping="Wrap" Foreground="Black" />
                </ScrollViewer>
                <Grid.Background>
                    <ImageBrush ImageSource="/SunwellLauncher;component/Images/content-bg.jpg" Stretch="Fill" TileMode="None" />
                </Grid.Background>
            </Grid>
            <Image Source="/SunwellLauncher;component/Images/wheel.png" Stretch="Fill" Grid.ColumnSpan="2" Grid.RowSpan="2" Width="123" Height="131" VerticalAlignment="Top" HorizontalAlignment="Left" />
            <Grid.Background>
                <ImageBrush ImageSource="/SunwellLauncher;component/Images/right-bg.jpg" Stretch="UniformToFill" TileMode="None" />
            </Grid.Background>
        </Grid>
        </Border>
        <Border x:Name="brdRealmlistBorder" Grid.ColumnSpan="1" Grid.Column="1" Margin="5,0,0,0" BorderBrush="#D3000000" BorderThickness="4" Width="0">
            <Grid x:Name="grdRealmlist">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80*" />
                    <ColumnDefinition Width="80*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="20*" />
                    <RowDefinition Height="207*" />
                    <RowDefinition Height="30*" />
                    <RowDefinition Height="30*" />
                </Grid.RowDefinitions>
                <ListBox x:Name="lstbRealmlist" ItemsSource="{Binding}" Grid.ColumnSpan="2" Grid.Row="1" Width="132" Height="220" Margin="10,0" HorizontalAlignment="Left" VerticalAlignment="Center" ItemContainerStyle="{StaticResource ListboxItemStyle}">
                    <ListBox.Background>
                        <ImageBrush ImageSource="/SunwellLauncher;component/Images/content-bg.jpg" Stretch="UniformToFill" TileMode="None" />
                    </ListBox.Background>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Border BorderThickness="1" BorderBrush="#FFBA7C0E" Margin="1" CornerRadius="3" >
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="2*"/>
                                        <RowDefinition Height="1*"/>
                                    </Grid.RowDefinitions>
                                    <Label Content="{Binding Name}" FontSize="16"/>
                                    <Label Content="{Binding Website}" Grid.Row="1"/>
                                </Grid>
                            </Border>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <Button x:Name="btnSet" Cursor="Cursors/hover.cur" Grid.Row="2" Grid.ColumnSpan="2" Content="Ustaw" Margin="10,0,10,8" Click="btnSet_Click" Foreground="#FFE5C34F" FontWeight="SemiBold">
                    <Button.Background>
                        <ImageBrush ImageSource="/SunwellLauncher;component/Images/button_normal.png" />
                    </Button.Background>
                </Button>
                <Button x:Name="btnAdd" Cursor="Cursors/hover.cur" Grid.Row="3" Grid.ColumnSpan="1" Content="Dodaj" Margin="10,-2,2,10" Click="btnAdd_Click" FontWeight="SemiBold" Foreground="#FFE5C34F">
                    <Button.Background>
                        <ImageBrush ImageSource="/SunwellLauncher;component/Images/button_normal.png" />
                    </Button.Background>
                </Button>
                <Button x:Name="btnDel" Cursor="Cursors/hover.cur" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="1" Content="Usuń" Margin="5,-2,10,10" Click="btnDel_Click" FontWeight="SemiBold" Foreground="#FFE5C34F" >
                    <Button.Background>
                        <ImageBrush ImageSource="/SunwellLauncher;component/Images/button_normal.png" />
                    </Button.Background>
                </Button>
                <Grid.Background>
                    <ImageBrush ImageSource="/SunwellLauncher;component/Images/right-bg.jpg" Stretch="UniformToFill" TileMode="None" />
                </Grid.Background>
            </Grid>
        </Border>
    </Grid>
</Window>
